package cn.lkk.samples.lang.inheritance.basic;

/**
 * 演示继承的使用
 */
public class EmployeeTest {
    public static void main(String[] args) {
        Manager boss = new Manager("Cook", 50000, 2014, 5, 1);
        boss.setBonus(5000);

        //创建一个 Employee 数组，每个数组元素是一个 Employee 对象变量
        Employee[] staff = new Employee[3];

        staff[0] = boss;
        staff[1] = new Employee("Jim", 10000, 2015, 6, 1);
        staff[2] = new Employee("Tom", 20000, 2013, 12, 1);

        for (Employee e : staff) {
            System.out.println(e.getName() + " : " + e.getSalary());
        }
    }
}
